
#ifndef _TTG_UTILS_PARAMETERS_BASICPARAMETERSET_
#define _TTG_UTILS_PARAMETERS_BASICPARAMETERSET_
#include "Common/Definitions.h"

#include "Common/Math.h"
#include "Runtime.Low/Utils/UtilManagerDll.h"

namespace ttg_internal
{
	namespace utils
	{
		//OOP-styled wrapper for parameter sets (wraps UtilManager functions).
		class BasicParameterSet
		{
			private:
				ttg::math::uint64 ID;
			public:
				//Creates sub-set with requred name in the root set.
				inline BasicParameterSet(const char *name)
				{ ID = UtilManagerDll::getRef()->createRootParameterSet(name); }
				//Creates requred sub-set.
				inline BasicParameterSet(const char *name, BasicParameterSet *owner)
				{ ID = UtilManagerDll::getRef()->createParameterSet(name, owner->ID); }
				//Returns unique ID of this parameter set.
				//It can be used as a hash-value.
				inline ttg::math::uint64 getID()
				{ return ID; }
				//Unregisters sub-set.
				~BasicParameterSet()
				{ UtilManagerDll::getRef()->releaseParameterSet(ID); }
			friend class BasicParameter;
		};
	}
}

#endif
